//
//  TWFooterView.swift
//  EyepetizerImitative
//
//  Created by 田伟 on 2017/3/14.
//  Copyright © 2017年 个人. All rights reserved.
//

import UIKit

class TWFooterView: UIView {

    @IBOutlet weak var loading_in_ImageView: UIImageView!

    class func createFooterView()-> TWFooterView {
        return Bundle.main.loadNibNamed("TWFooterView", owner: nil, options: nil)?.first as! TWFooterView
    }
    /// 添加旋转动画
    func addRotationAnimation() {
        // 1创建动画
        let rotationAnim = CABasicAnimation(keyPath: "transform.rotation.z")
        // 2设置动画属性
        rotationAnim.fromValue = 0
        rotationAnim.toValue = M_PI * 2
        rotationAnim.repeatCount = MAXFLOAT // 一直旋转
        rotationAnim.duration = 1
        rotationAnim.isRemovedOnCompletion = false
        // 3将动画添加到layer中
        loading_in_ImageView.layer.add(rotationAnim, forKey: nil)
    }
}
